import java.time.*;

/**
 * @author zhouyanxiang
 * @Date  2020-11-2020/11/23-16:21
 */
public class Main {

    public static void main(String[] args) {
        // 获取当前日期 2020-11-23
        LocalDate date = LocalDate.now();
        System.out.println("当前日期是: " + date);

        // 获取当前时间 2020-11-23T16:25:34.903
        LocalDateTime time = LocalDateTime.now();
        System.out.println("当前时间是: " + time);

        // 获取当前月份 NOVEMBER
        Month month = time.getMonth();
        int day = time.getDayOfMonth();
        int year = time.getYear();
        LocalTime localTime = LocalTime.of(16,50);
        System.out.println("当前月份是: " + month);
        System.out.println("当前天数是: " + day);
        System.out.println("当前年份是: " + year);
        System.out.println("当前时间戳是: " + localTime);


        // ZonedDateTime
        System.out.println("==============");
        ZoneId zoneId = ZoneId.systemDefault();
        System.out.println("解析字符串： " + zoneId);
        ZonedDateTime zonedDateTime = ZonedDateTime.now();
        System.out.println("ZonedDateTime: " +zonedDateTime);
    }

}
